package com.example.safelib

import com.example.baselib.BaseRepository
import com.example.baselib.databean.ResponseData
import huaan.com.mvvmdemo.http.RetrofitClient
import okhttp3.ResponseBody
import retrofit2.Response

/**
 * Author: sxygsj
 * Date: 2020/4/24 13:47
 * Description: Safe 网络请求
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
class SafeRepository :BaseRepository(){
    suspend fun loadAlarmData(token: String, unitcode: String):Response<ResponseData<String>> =request{
        RetrofitClient.reqApi().loadAlarmData(token,unitcode)
    }

    suspend fun loadSenName(token: String, unitcode: String) :Response<ResponseData<String>> =request{
        RetrofitClient.reqApi().loadSenName(token,unitcode)
    }
    suspend fun loadSenInfo(token: String, unitcode: String) :Response<ResponseData<String>> =request{
        RetrofitClient.reqApi().loadSenInfo(token,unitcode)
    }
    suspend fun loadLineChart(token: String, map: HashMap<String,String>):Response<ResponseBody> =  request{
        RetrofitClient.reqApi().loadLineChart(token,map)
    }

    suspend fun loadReportData(token: String, unitcode: String, date: String) =request{
        RetrofitClient.reqApi().loadReportData(token,unitcode,date)
    }

    suspend fun loadSensorInfo(token: String, unitcode: String, sensornum: String) =request{
        RetrofitClient.reqApi().loadSensorInfo(token,unitcode,sensornum)
    }

    suspend fun loadSafeNickData(token: String)=request {
        RetrofitClient.reqApi().loadSafeNickData(token)
    }
}